<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>마이 페이지</title>
<script type="text/javascript" src="/bigjo/js/jquery.js"></script>
</head>
<style type="text/css">
table {
	margin-top: 100px;
}
</style>
<script type="text/javascript">
	jQuery.noConflict();
	jQuery(document).ready(function() {
		jQuery(".mypage").click(function() {
			var idx = document.URL.indexOf("bigjo");
			var str = document.URL.substring(0, idx + 5);
			var m_id = jQuery("#myid").val();
			alert(m_id);
			jQuery.ajax({
				url : str + "/myinfoForm.mb?m_id=" + m_id,
				error : function(data) {
					alert("오류 발생");
				},
				success : function(data) {
					jQuery("#mypagediv").html(data);
				}
			});

		});

		jQuery.noConflict();
		jQuery("#buylist").click(function() {
			alert("buylist 클릭");
			var idx = document.URL.indexOf("bigjo");
			var str = document.URL.substring(0, idx + 5);
			var m_id = jQuery("#myid").val();

			jQuery.ajax({
				url : str + "/buylist.mb?m_id=" + m_id,
				error : function(data) {
					alert("오류 발생");
				},
				success : function(data) {
					jQuery("#mypagediv").html(data);
				}
			});
		});
		jQuery.noConflict();
		jQuery("#push").click(function() {
			alert("push 클릭");
			var idx = document.URL.indexOf("bigjo");
			var str = document.URL.substring(0, idx + 5);
			var m_id = jQuery("#myid").val();

			/* 		jQuery.ajax({
			 url : str + "/myinfoForm.mb?m_id="+m_id,
			 error:function(data){
			 alert("오류 발생");
			 },
			 success : function(data){
			 jQuery("#main_View").html(data);
			 }
			 }); */
			/* jQuery("#main_View").load(str + "/pushForm.mb"); */
		});
		jQuery.noConflict();
		jQuery(".hadoop").click(function() {
		var hadoop = jQuery(this).attr("hadoop");
		var idx = document.URL.indexOf("bigjo");
		var str = document.URL.substring(0, idx + 5);
		
		jQuery.ajax({
			url : str + hadoop,
			error : function(data) {
				alert("오류 발생");
			},
			beforeSend : function(){
				jQuery("#result").html("<p align='center'><font size='20'>처리중...</font></p>");
			},
			complet : function(){
			},
			success : function(data) {
				document.location.href=str+hadoop;
			}
		});
		
		});
	});
</script>

<body>
	<jsp:include page="/upMenu.main"></jsp:include>
	<div id="mypagediv">
	
		<table align="center">
				<c:choose>
					<c:when test="${sessionScope.member == 'admin' }">
					<div id="result" style="width: 1000px; height: 100px; margin: auto;"></div>
					<tr>
						<td><img class="hadoop" src="/bigjo/media/image/hadoop.png"width="100" height="100" hadoop="/put.ha"></td>
						<td><img class="hadoop" src="/bigjo/media/image/singerAdmin.png"width="100" height="100" hadoop="/regSinger.ha"></td>
						<td><img class="hadoop" src="/bigjo/media/image/musicAdmin.png"width="100" height="100" hadoop="/regMusic.ha"></td>
					</tr>
					</c:when>
					<c:otherwise>
					<tr>
						<td><img id="mypage" class="mypage"
							src="/bigjo/img/mypage.png" width="100" height="100"></td>
						<td><input type="hidden" id="myid" value="${member}"></td>
						
						<td><img id="push" src="/bigjo/img/push.png" width="100"
							height="100"></td>
					</tr>
					</c:otherwise>
				</c:choose>
		</table>
	</div>
</body>
</html>